# Maintainer: Jaroslav Lichtblau <setlemodry@archlinux.org>
# Contributor: William Rea <sillywilly@gmail.com>

pkgname=pork
pkgver=0.99.8.1
pkgrel=22
pkgdesc="Console-based AOL Instant Messenger & IRC client"
arch=('loong64' 'x86_64')
url="http://dev.ojnk.net/"
license=('GPL')
depends=('ncurses' 'perl')
source=(https://downloads.sourceforge.net/sourceforge/ojnk/$pkgname-$pkgver.tar.gz{,.asc}
        fix-format-security.patch
        perl-5.36.patch)
sha256sums=('f0d4cad21017fd75b3c200342c54dd56d9ff7bc38d1e9b3c8ba686ba53d585ed'
            'SKIP'
            '1fa4ac8f5571f6a8f5f64da34607fc305be8f1aad9cdc5cfa64a00047a45cdc1'
            'ff20edc7c939146c43a7cc5a3b95aa91b2fbcc2f908863438d6da9b464f7def3')
validpgpkeys=('7A4533F19780BF32793C1820DAD25608075C69BC') # Ryan McCabe (Odin) <odin@numb.org>

prepare() {
  cd $pkgname-$pkgver
  patch -Np1 -i ../fix-format-security.patch
  patch -Np1 -i ../perl-5.36.patch
}

build() {
  cd $pkgname-$pkgver

  CFLAGS+=' -fgnu89-inline'

  ./configure --prefix=/usr
  make
}

package() {
  cd $pkgname-$pkgver

  make DESTDIR="${pkgdir}" install
}
